/*
 *-----------------------------------------------------------------------------
 * Copyright 2012 NCR Corporation
 *-----------------------------------------------------------------------------
 * All revision information is updated automatically from source code control
 * change records - please do not manually edit.
 *-----------------------------------------------------------------------------
 *
 *-----------------------------------------------------------------------------
 * $LastChangedRevision:: 4572                                      $
 * $LastChangedBy:: ms185252                                        $
 * $LastChangedDate:: 2012-05-14 16:27:35 -0400 (Mon, 14 May 2012)  $
 *-----------------------------------------------------------------------------
 */
package com.ncr.travel.airline.shared.configuration.checkin;

import java.util.Collection;
import java.util.List;
import java.util.Set;

import com.ncr.travel.airline.shared.configuration.converters.CountryAirportCode.CountryReference;
import com.ncr.travel.airline.shared.configuration.converters.FeatureSettings;
import com.ncr.travel.tas.configuration.model.ConfigurationValue;
import com.ncr.travel.tas.configuration.model.ConfigurationValueTemplate;
import com.ncr.travel.tas.configuration.service.messaging.ConfigurationService;
import com.ncr.travel.tas.shared.configuration.ConfigurationServiceException;

/**
 * @author ms185252
 * @version $Revision: 4572 $
 * @since <a href="http://jira.sweng.ncr.com/browse/[current_issue_number]">[Project/effort name] Project</a>
 */
public interface CommonCheckInConfiguration {

    Set<ConfigurationValue> getConfigurationChildren(CheckInConfiguration node);

    String getHostAirlineCode();

    String getHostAirlineLoyaltyProgramName();

    String getHostAirlineName();

    ConfigurationValueTemplate getTemplateForField(CheckInField field);

    ConfigurationValueTemplate getTemplateForOptionslField(CheckInFeature findByOption, FindByOptionalField field);

    /**
     * Determines whether or not a high-level Check-In product feature is on
     * 
     * @param feature
     * @return
     */
    boolean isFeatureOn(CheckInFeature feature);

    boolean isFindByOptionalFieldOn(CheckInFeature feature, FindByOptionalField field);

    /**
     * Removes any current data from the cache; new requests will be serviced by the database. This method is used
     * primarily for testing, but can also be used to refresh the configuration from the database.
     */
    void reset();
    
    /**
     * Allows injection of a configured service bean
     * 
     * @param configurationService the database management bean
     */
    void setConfigurationService(ConfigurationService configurationService);

    /**
     * Retrieves all information for the currently-enabled countries.
     * 
     * @return the available country data
     */
    Collection<CountryReference> getAvailableCountries();

    /**
     * Retrieves the enabled subdivisions (states, departments, etc.) for the identified country.
     * 
     * @param countryCode the ISO 3166-1 alpha3 country code for which data will be retrieved
     * @return the available data
	 * @throws ConfigurationServiceException if the configuration is not present
     */
    List<ConfiguredPair> getCountrySubdivisions(String countryCode);

    /**
     * Determines the parent country if the identified country is a territory.
     * 
     * @param countryCode the ISO 3166-1 alpha3 country code for which data will be retrieved
     * @return the parent country, or the same country if no data is available
	 * @throws ConfigurationServiceException if the configuration is not present
     */
    String getParentCountry(String countryCode);
    
    FeatureSettings getSettingsForFeature(CheckInFeature feature);

}
